//
//  Unity.h
//  PowerOnHD
//
//  Created by Srain on 13-5-29.
//  Copyright (c) 2013年 lu yingzhi. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#include <mach/mach.h>
#import <QuartzCore/QuartzCore.h>

typedef enum {
    ios5,
    ios6,
    ios7,
    noVersion
}SystemVersionType;

@interface Unity : NSObject
+ (UIImageView *)rotate360DegreeWithImageView:(UIImageView *)imageView;
+(UIColor*)getBackColor;
+(UIColor*)getTableItemSeleteColor;
//缓存数据
+ (void)saveCache:(NSString*)type  andString:(NSMutableArray *)str;
//取数据
+ (NSMutableArray *)getCache:(NSString *)type;
+(NSDate *)stringToDate:(NSString *)string;
+(NSDate *)stringToTime:(NSString *)string;
+(NSDate *)stringToTimeMM:(NSString *)string;
+(NSString *)dateToString:(NSDate *)date;
+(NSString *)timeToString:(NSDate *)date;
+(NSString *)timeToMMString:(NSDate *)date;
+(NSString *)timeToMMString;
//根据宽度和字体 自动计算文本高度
+(CGFloat) getLabelHeightWithWidth:(CGFloat)labelWidth andDefaultHeight:(CGFloat)labelDefaultHeight andFontSize:(CGFloat)fontSize andText:(NSString *)text;
+(NSString*)systemTime;     //系统时间
+(NSString*)systemTimeToMM;

//encodeURL只能用来对url中的component编码，不能用来对整个url进行编码。
+(NSString*)encodeURL:(NSString*) unescapedString;

//获取文本颜色
+(UIColor *)getColor:(NSString *) stringToConvert;

//打印内存
+(void)logMemoryInfo;

+(UIViewController*)getViewController:(UIView*)view;

+(NSString*)intToString:(int)temp;

+(void)toViewController:(UINavigationController*)navigationController withLastCount:(int)count;

+(void)ShowWait:(NSString*)text;
+(void)HideWait;

+(void)showAlert:(NSString*)message;


+ (BOOL)isBlankString:(NSString *)string;
//验证QQ
+(BOOL)isValidateQQ:(NSString *)QQ;
+(BOOL)verfierEmail:(NSString *)email;
+(BOOL)verfierPwd:(NSString*)password;

+(SystemVersionType)currentVersion;
+(BOOL)isMsgCode:(NSString *)code;
+(BOOL)isValidateTelphone:(NSString *)telPhone;
+(NSString*)UUID;
+(double)GetStringTimeDiff:(NSString*)timeS timeE:(NSString*)timeE;
+(NSString*)GetCurTime;
+(NSString *)requestSomeApiData:(NSMutableDictionary *)head withBody:(NSMutableDictionary *)body;
@end
